This invention relates to editing of digital images. Modem graphics application programs, such as the Adobe Photoshop(copyright) program, produced by Adobe Systems Incorporated of San Jose, Calif., allow a user to paint portions of a digital image. This is usually accomplished with various types of brush-like or pen-like painting tools, which allow a user to create intuitively a modification of the digital image in a local neighborhood of the brush or pen. Tools of this type are usually raster-based and operate on raster images, that is, the tools apply paint by changing the color of a digital image on a pixel-by-pixel basis. Raster-based tools provide a natural and intuitive painting metaphor for modifying an image, but the painting that is made by raster-based tools is resolution dependent. When a raster painted image is at high magnification it will appear jagged and lose detail.
In contrast to raster-based painting tools, there are also vector-based painting tools. Vector-based painting tools apply changes to a digital image based on a mathematical model and are resolution-independent. Consequently, edges look smooth even when the digital image is magnified. Furthermore, in graphics applications that allow manipulations of moving objects, such as the Adobe AfterEffects(copyright) application, the objects are normally represented by vectors. If an object in such an application needs to be modified, the modification has to be performed using a vector-based tool. An example of a set of vector-based tools can be found in the Adobe Illustrator(copyright) application, in which a Smooth tool can modify entire paint strokes applied with a Paint tool or a Pencil tool. In addition, a large range of styles can be applied to each paint stroke, strokes can be created with arbitrary variation in radius along a curve, and the overall opacity of the strokes can be changed.
Another example of a vector-based painting tool has been described in U.S. patent application Ser. No. 09/056,567, now U.S. Pat. No. 6,208,355, filed on Apr. 7, 1998, for Sketch Based Editing Of Curves. This vector-based painting tool is used to correct undesirable bumps and flat portions that occur in curves that have been drawn with freehand gestures in an electronic document using input devices such as a mouse or graphics tablet. The tool allows a user to replace the bumps and flat portions with smooth curves by using a xe2x80x9csketch-likexe2x80x9d movement of the input device to create a replacement curve. The bumps or flat portions are then removed and replaced with the smooth replacement curve segments. The process is comparable to when an artist is drawing with pen and paper and modifies a curve by drawing another line or curve in an area that is undesirable, covering the undesirable portion.
However, this process can only be used to change the shape of a curve and cannot be used to change the color or any other appearance properties of a path. Most users experience conventional vector-based painting tools to be much less intuitive to use than raster-based tools. In addition, vector-based tools lack some of the flexibility of raster-based tools.
The present invention provides tools and methods for creating and editing paths in electronic documents. In this context, a path is an element of electronic artwork that is based on a one dimensional curvexe2x80x94which may be defined in one or more segmentsxe2x80x94that defines a shape or trajectory of the path. In addition to its shape, a path can have one or more stylistic properties, such as color or radius, that can be constant or variable along its length. A path has two or more vertices that are connected by path segments. Two of these vertices are endpoints of the path.
In general, in one aspect, the invention provides methods and apparatus, including computer program products, implementing and using techniques for locally modifying a stylistic property of at least one path in an electronic document. In this aspect all or a portion of an electronic document and at least one brush tool is displayed to a user. The electronic document has paths defined by parametric vector curves, and the brush tool is indicated by a cursor and having a region of influence. A user input selecting a brush tool and positioning the selected brush tool on the electronic document is received and a stylistic property of paths that pass within the region of influence of the selected brush tool is changed in response to a continuous user-controlled gesture of the brush tool. The stylistic property is a vector-based appearance property that varies along a path.
Advantageous implementations can include one or more of the following features. The region of influence can be a changeable parameter of the brush tool. The size, the shape, the rotation, and the strength of the region of influence can be changeable. The parametric vector curves can be curves in a two-dimensional space. The parametric vector curves can be represented by polynomials. The parametric vector curves can be Bezier curves. The stylistic property can be changed by altering the vectors that represent the stylistic property. The change of the stylistic property can be a localized change and only affect the parts of the paths that pass within the region of influence of the selected brush tool. The stylistic property of the path can be changed by an amount that is proportional to the distance the selected brush tool is moved during the continuous user-controlled movement of the brush tool. The stylistic property can be described by a polynomial and the components of the vectors associated with the stylistic property can correspond to coefficients in the polynomial. The polynomial can be a cubic polynomial and each polynomial coefficient can have an associated stiffness coefficient. The stylistic property may be a property unrelated to the shape of the path and can for example be the width of the path, the opacity of a stroke of the path, or a color property of a fill of the path. The color property can, for example, be the luminosity, the hue, or the saturation of the fill of the path. The stylistic property can be instances of a pattern that are stamped along the path. Changing a stylistic property may, for example, comprise locally rotating, locally translating, locally scaling, or locally distorting one or more instances of the pattern. Changing a stylistic property may comprises changing a stylistic property only for the path in the electronic document that at any given moment passes closest to a center of the region of influence of the selected brush tool.
In general, in another aspect, the invention provides methods and apparatus, including computer program products, implementing and using techniques for locally modifying a stylistic property of at least one path in an electronic document. In this aspect at least a part of the electronic document with the at least one path is displayed to a user. Each path is defined by a parametric vector curve and has at least one stylistic property. The stylistic property is a vector-based appearance property that varies along the path. User inputs selecting a location in the electronic document, a region of influence around the location, and a stylistic property to be modified are received, and the selected stylistic property of paths that lie within the region of influence is locally modified by altering the vectors associated with the stylistic property.
Advantageous implementations can include one or more of the following features. A user input indicating the degree of localization and extent of the modification of the stylistic property can be received. Each path may be delimited by two vertices. One or more vertices can be added to divide the path into smaller path segments, where each path segment is defined by a smaller parametric vector curve and having at least one vector-based stylistic property. The stylistic property of path segments within the region of influence can be locally modified by altering the vectors associated with the stylistic property. The selected stylistic property can be modified based on an amplification factor associated with the path.
In general, in another aspect, the invention provides methods and apparatus, including computer program products, implementing and using techniques for locally modifying a stylistic property of at least one path in an electronic document. In this aspect all or a portion of an electronic document and at least one brush tool is displayed to a user. The electronic document has paths defined by polynomials, and the brush tool is indicated by a cursor and has a region of influence. A user input selecting a brush tool and positioning the selected brush tool on the electronic document is received vectors that are associated with at least one path that passes within the region of influence of the selected brush tool are altered in response to a user-controlled gesture of the brush tool. The vectors represent a width of the at least one path that varies along the at least one path.
In general, in another aspect, the invention provides methods and apparatus, including computer program products, implementing and using techniques for locally modifying a stylistic property of at least one path in an electronic document. In this aspect all or a portion of an electronic document and at least one brush tool is displayed to a user. The electronic document has paths that are defined by parametric vector curves, and the brush tool is indicated by a cursor and has a region of influence. A user input selecting a brush tool and positioning the selected brush tool on the electronic document is received and an appearance property is locally changed for parts of the paths that pass within the region of influence of the selected brush tool in response to the distance that the brush tool is moved during a continuous user-controlled gesture. The appearance property is a vector-based property that is unrelated to the shape of a path and varies along the path.
Advantageous implementations can include one or more of the following features. The appearance property may, for example, be the width of the path, the opacity of a stroke of the path, or a color property of a fill of the path.
In general, in another aspect, the invention provides methods and apparatus, including computer program products, implementing and using techniques for editing a digital movie that has a first keyframe, a second keyframe, and intermediate frames. In this aspect the first keyframe and at least one brush tool is displayed to a user. The first keyframe has paths defined by a parametric vector curves, and the brush tool is indicated by a cursor and having a region of influence. A first user input selecting a brush tool and using the brush tool to change a stylistic property of paths in the first keyframe that pass within the region of influence of the selected brush tool is received. The stylistic property is a vector-based appearance property that varies along a path. The second keyframe and the selected brush tool is displayed to the user. The second keyframe has paths defined by parametric vector curves corresponding to the paths in the first keyframe. A second user input using the selected brush tool to change the stylistic property of paths in the second keyframe that pass within the region of influence of the selected brush tool is received. A change of the stylistic property for paths in intermediate keyframes corresponding to the changed paths in the first and second keyframes is automatically interpolated.
The invention can be implemented to include one or more of the following advantages. Paths in a digital image can be dynamically painted and edited using brush-like tools while maintaining a vector model of the path and its attributes. Examples of such brush tools include a radius-changing brush that thickens or thins the brush strokes in a local neighborhood of the brush, an opacity-changing brush that increases or decreases the brush stroke opacities in the local neighborhood, and a color-changing brush that locally changes the brush stroke colors. The user can change the local neighborhood, or region of influence, of the brush. The selected brush can affect all the paths that lie within the radius of influence of a brush. The same brush tool can affect different paths differently. The user can also control the degree of localization for the changes, that is, how large are the sections of the paths that are affected by a given brush tool movement. These advantages, by themselves or in combination, give the user great flexibility and add new ways of editing vector-based paths in digital images. The brush tools also provide a more intuitive way of modifying vector-based paths than conventional vector-based tools do.
The details of one or more embodiments of the invention are set forth in the accompanying drawings and the description below. Other features, objects, and advantages of the invention will be apparent from the description and drawings, and from the claims.